package com.heima.article.controller.v1;

import com.heima.article.service.ApArticleLikesService;
import com.heima.model.common.dtos.ResponseResult;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/api/v1/article/likes")
public class ArticleLikesController {

    @Resource
    private ApArticleLikesService apArticleLikesService;

   /* *//**
     * 点赞或取消点赞文章
     * @param userId 用户ID
     * @param articleId 文章ID
     * @param isLike 是否点赞 true-点赞 false-取消点赞
     * @return
     *//*
    @PostMapping("/like")
    public ResponseResult likeArticle(@RequestParam Integer userId,
                                     @RequestParam Long articleId,
                                     @RequestParam Boolean isLike) {
        return apArticleLikesService.likeArticle(userId, articleId, isLike);
    }

    *//**
     * 判断文章是否被点赞
     * @param userId 用户ID
     * @param articleId 文章ID
     * @return
     *//*
    @GetMapping("/isLiked")
    public ResponseResult isArticleLiked(@RequestParam Integer userId,
                                        @RequestParam Long articleId) {
        return apArticleLikesService.isArticleLiked(userId, articleId);
    }

    *//**
     * 获取用户点赞文章列表
     * @param userId 用户ID
     * @param page 页码
     * @param size 每页大小
     * @return
     *//*
    @GetMapping("/user/{userId}")
    public ResponseResult getUserLikedArticles(@PathVariable Integer userId,
                                               @RequestParam(defaultValue = "1") Integer page,
                                               @RequestParam(defaultValue = "10") Integer size) {
        return apArticleLikesService.getUserLikedArticles(userId, page, size);
    }*/
}